﻿
using System.Web.Mvc;

namespace EasyLift.TMS.Web.Models
{

    public class MissionHeaderViewModel
    {
        public MissionHeader MissionHeader { get; set; }
        public SelectList MissionStatus { get; private set; }
        public SelectList MissionType { get; private set; }

        public MissionHeaderViewModel(MissionHeader missionHeader)
        {
            MissionHeader = missionHeader;

            MissionStatusRepository missionStatusRepository = new MissionStatusRepository();
            var statsSet = missionStatusRepository.GetAllData();
            MissionStatus = new SelectList(statsSet, " MissionStatusCode", " MissionStatusDescription",  MissionHeader.MissionStatusCode);

            MissionTypeRepository missionTypeRepository = new MissionTypeRepository();
            var misstionTypeSet = missionTypeRepository.GetAllData();
            MissionType = new SelectList(misstionTypeSet, "MissionTypeCode", " MissionTypeDescription", MissionHeader.MissionTypeCode);
        }
    }
}